package com.example.javafx.标签;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

/**
 * 创建垂直标签
 */
public class Main_4 extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        Scene scene = new Scene(new Group());
        primaryStage.setTitle("Label Sample");
        primaryStage.setWidth(400);
        primaryStage.setHeight(180);

        HBox hBox = new HBox();
        Label label1 = new Label("Search");
        label1.setRotate(270);//设置旋转270度

        hBox.setSpacing(10);
        hBox.getChildren().add(label1);
        ((Group)scene.getRoot()).getChildren().add(hBox);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
